<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSystemGroupDataTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('system_group_data', function (Blueprint $table) {
            $table->id()->comment('组合数据详情表');
            $table->integer('group_id')->index()->comment('对应的数据组id');
            $table->json('value')->nullable()->comment('数据组对应的数据值（json数据）');
            $table->integer('sort')->default(0)->comment('数据排序');
            $table->tinyInteger('status')->default(1)->comment('状态 0=关闭 1=开启');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('system_group_data');
    }
}
